﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Libs.Content;

public partial class Controls_Home_InfoGraphic : System.Web.UI.UserControl
{
    public int CateID { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        NewsWeb _NewsWeb = new NewsWeb();
        List<NewsWeb> list;

        list = _NewsWeb.GetList(CateID, 0, 4);
        _NewsWeb = list[0];
        if (_NewsWeb.SubLead.Length > 200)
        {
            _NewsWeb.SubLead = _NewsWeb.SubLead.Substring(0, 200) + "...";
        }
        imgNewsTop.Src = AppUtils.ImageUrl(_NewsWeb.ImageUrl, "371", "235");
        hlNewsTop.InnerText = _NewsWeb.Title;
        hlNewsTop.HRef = hlNewsImgTop.HRef = _NewsWeb.Url;
        ltrLead.Text = _NewsWeb.SubLead;

        list.RemoveAt(0);
        rptList.DataSource = list;
        rptList.DataBind();
    }
}